package com.hedl.practice.diyJava.gather.study_equals.practice.tmp;

import java.util.Objects;

public class Person {
    String firstName;
    String lastName;
    int age;

    public Person(String firstName, String lastName, int age) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.age = age;
    }

    public boolean equals(Object o){
        if (o instanceof Person){
            Person p = (Person) o;
            return Objects.equals(this.firstName,p.firstName) && Objects.equals(this.lastName,p.lastName) && this.age == p.age;
        }
        return false;
    }
}
